/**
 * Created by 白雨浓 on 17-8-17 下午3:18.
 *
 * 事件总线
 */
const EventBus = {
    install(Vue) {
        const vue = new Vue({});
        Vue.prototype.$eventBus = {
            emit(event, ...args) {
                return vue.$emit(event, args);
            },
            on(event, callback) {
                return vue.$on(event, callback);
            },
            once(event, callback) {
                return vue.$once(event, callback);
            },
            off(event, callback) {
                return vue.$off(event, callback);
            }
        };
    }
};

export default EventBus;
